﻿<?php 
	//session_id($_GET['sid']);
	@session_start();
	error_reporting(E_ERROR);  
       	ini_set("display_errors","Off");  
	//require_once('../user/wxbrower.php');
	require_once("../includes/public.inc.php");
	//require_once("../includes/conn.php");
	$s=isset($_GET['s'])?$_GET['s']:'';
	$openid = isset($_GET['openid'])?$_GET['openid']:'';//echo $openid;exit;
	$username = isset($_SESSION['username'])?$_SESSION['username']:'';
	//不需要判断是否关注，主需要判断这个吗是否是存在而且是没被领取的
	//print_r($_SESSION['username']);exit;
	if($username)
	{
		if ($openid)
		{
			$exsit_openid = mysql_fetch_array(mysql_query("select * from ".DBQIAN."daogou where username='".trim($_SESSION['username'])."' order by id desc limit 1"));
			$fwm = mysql_fetch_array(mysql_query("select id,fwm,time from ".DBQIAN."fwm where fwm='".trim($s)."' and status=0 order by id desc limit 1"));//未使用,未领取奖品的
			$fwm1 = mysql_fetch_array(mysql_query("select id,fwm,time from ".DBQIAN."fwm where fwm='".trim($s)."' and status=1 order by id desc limit 1"));//已经使用,领取奖品的
		}
		else 
		{
			echo "<script>alert('非法进入，请检查提交的数据是否正确!!');</script>";exit;
		}
	}
	else 
	{
		echo "<script>alert('非法进入，请先登录!');window.parent.location.href='login.php';</script>";
		exit;
	}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="user-scalable=no,width=device-width, initial-scale=1.0 maximum-scale=1.0">
<meta name="Keywords" content="正品验证" />
<meta name="Description" content="正品验证" />
<title>曼妮诗</title>
<link rel="stylesheet" href="Public/css/home.min.css" />
<script src="./Public/js/jquery-1.7.2.min.js"></script>
<script language="javascript" type="text/javascript" src="Public/js/sel.js"   charset="gb2312"></script>
<script type="text/javascript">
	var ua = navigator.userAgent;
	var ipad = ua.match(/(iPad).*OS\s([\d_]+)/),
    isIphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/),
    isAndroid = ua.match(/(Android)\s+([\d.]+)/),
    isMobile = isIphone || isAndroid;
    if(isMobile) 
    {
        return true;
    }
    else
    {
        location.href = 'tip.php';
    }
    //或者单独判断iphone或android 
//    if(isIphone){
//        //code 
//    else if(isAndroid){
//        //code
//    }else{
//        //code
//    }
</script>
<style type="text/css">
.td{border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;}
.table{border:solid #000; border-width:1px 0px 0px 1px;}
input
{
	BACKGROUND-COLOR: transparent;
	BORDER-BOTTOM: #000 1px solid;
	BORDER-LEFT: #000 1px solid;
	BORDER-RIGHT: #000 1px solid;
	BORDER-TOP: #000 1px solid;
	COLOR: #FFF;
	WIDTH:200px;
	HEIGHT: 28px;
	border-color: #FFD300 #FFD300 #FFD300 #FFD300; font-size: 9pt;
	-moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-radius:5px;
}
</style>
</head>
<body class="ui-bar-a" style="background-color:#e50065;background-image:url(../user/images/yalina.png);">
<img src="../images/logo.png" style="margin-left:17px; margin-top:9px;" width="120px" height="45px"/>
<div class="load_box" style="margin-top:-245px; width:280px; text-align:center;margin-left:-140px;">
	<div style="margin-left:auto;margin-right:auto;top:7px;text-align:center;font-size:19px;font-weight:bolder;">
			
	</div>
</div>

<div style="width:86%; margin-left:auto;margin-right:auto;">
	<div style="width:100%; text-align:center;margin-top:32px;">
		<table width="100%" style="margin-left:auto;margin-right:auto;background-color:#000;opacity: 0.7;-moz-border-radius: 6px;-webkit-border-radius: 6px;border-radius:6px;">
			<tr>
				<td style="color:#FD7297; font-weight:bolder;" colspan="2"  height="40px">
				</td>
			</tr>
			<?if ($exsit_openid['id']&&isset($fwm)&&$fwm):?>
			<tr>
				<td style="color:#FD7297; font-size:14px; font-weight:bolder;" colspan="2" align="center"  height="40px">
					该产品为正品!<br/>恭喜获得红包一个!<br/>请点击领取按钮领取!
				</td>
			</tr>
			<tr>
				<td style="color:#FD7297; font-size:14px; font-weight:bolder;" colspan="2" align="center"  height="40px">
					<input type="button" onclick="window.location.href='<?=WEBNAME?>main/chaikai.index.php?sk=1445313033&sh=43920&s=<?=$fwm['fwm']?>&type=dg&openid=<?=$openid?>'" style="font-size:14px;font-weight:bolder; background-color:#FC0044;border-color:#BD2F55; width:80%;height:32px;" value="领取红包" >
				</td>
			</tr>
			<?elseif ($exsit_openid['id']&&isset($fwm1)&&$fwm1):?>
			<tr>
				<td style="color:#FD7297; font-size:14px; font-weight:bolder;" colspan="2" align="center"  height="40px">
					曼妮诗
				</td>
			</tr>
			<?else:?>
				<?if ($exsit_openid['id']):?>
					<tr>
						<td style="color:#FD7297; font-size:14px; font-weight:bolder;" colspan="2" align="center"  height="40px">
							该产品是假冒产品,请谨慎使用!
						</td>
					</tr>
				<?else :?>
					<?
						header("Location: register.php?s=".$s."&openid=".$openid);exit;
					?>
				<?endif;?>
			<?endif;?>
			<tr>
				<td style="color:#FFD300; font-size:10px;" colspan="2" align="center"  height="40px">该活动的最终解释权归曼妮诗所有</td>
			</tr>
		</table>
	</div>
<div class="load_box" style="margin-top:15px;height:120px; position:relative;">
	<div class="liwuso_logo"><img src="../images/t01739705f991e0d14f.gif" width="90%" /></div>
</div>
</div>

<footer id="footer" class="index_footer" style="position:relative;">
	<div class="copy">
		<div style="margin-left:-90px">
			<img src="../images/mom.jpg"  width="100" height="100" /><span style="float:left;position:absolute;width:100px;font-size:14px;height:50px;text-align:left;margin-top:0px;">#长按关注#或者打开微信客户端搜索微信公众号<span style="color:yellow;">曼妮诗</span>进行关注了解更多</span><br>
		</div>
		<span style="color:#000">&copy;2016 曼妮诗 All Rights Reserved.</span>
	</div>
</footer>
</body>
</html>